package com.wing.purchase.model.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 采购入库计划
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("pur_purchase_warehousing_plan")
public class PurchaseWarehousingPlan extends BaseEntity<PurchaseWarehousingPlan> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Status implements IEnum<Integer> {

        /**
         * 待签收
         */
        staySignFor(0, "待签收"),
        /**
         * 签收中
         */
        signForIt(1, "签收中"),
        /**
         * 已签收
         */
        hasSignFor(2, "已签收"),
        /**
         * 入库中
         */
        warehousing(3, "入库中"),
        /**
         * 已入库
         */
        complete(4, "已入库");

        private int code;
        private String desc;

        Status(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public Integer getValue() {
            return this.code;
        }

        public String getDesc() {
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 采购入库计划编号
     */
    private String planNo;

    /**
     * 供应商发货记录ID
     */
    private Long purchaseDeliveryRecordId;

    /**
     * 状态
     */
    private Status status;

    /**
     * 状态描述
     */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }

    /**
     * 入库仓库类型
     */
    public Long warehouseType;

    /**
     * 入库仓库
     */
    public Long warehouse;


}
